home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: Overloading problem with kernal/Class read/write
- Date: 5 Feb 1996 21:49:52 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4f5u20$7bc@news1.usa.pipeline.com>
- NNTP-Posting-Host: 38.8.60.2
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Feb 05, 1996 12:41:28 in article <Overloading problem with kernal/Class
- read/write>, 'clare@shell.portal.com (Clare Chu)' wrote:
-
-
- >
- >Hi, I'm sort of new to C++, so please bear with me.
- >
- >I wrote a little file class that has memberfunctions
- >"read" and "write". Those member functions use the
- >kernal "read" and "write". However when I try to
- >link/load my program, the load map complains about
- >the function signature of the kernal "read" and "write"
- >as not being defined (it isn't the same signature
- >as the File Class "read" and "write".
- >
- >I got around this by using "readin" and "writeout"
- >as my member functions, but somehow this doesn't
- >satisfy me. There's got to be a way for me to use
- >"read" and "write", is there?
- >
- >Can someone explain? Thanks, Clare
-
- When you name your member functions the same as some
- non-member, and you wish to call those non-member functions
- from within a member, you must ust the global scope operator
- to indicate your intent:
-
- void File::write(...)
- {
- ::write(fd, ....);
-
- --
- Pete Grant
- Kalevi, Inc.
- Object Oriented Software Development
-